package com.cgt.xiaotao.order.domain.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.cgt.xiaotao.model.model.base.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.util.Date;

@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(description = "支付记录表")
@TableName("payment")
public class Payment extends BaseEntity {

    @ApiModelProperty(value = "支付ID")
    @TableId(type = IdType.AUTO)
    @TableField("id")
    private Long id;

    @ApiModelProperty(value = "用户ID")
    @TableField("user_id")
    private Long userId;

    @ApiModelProperty(value = "订单ID")
    @TableField("order_id")
    private Long orderId;

    @ApiModelProperty(value = "订单编号")
    @TableField("order_No")
    private String orderNo;

    @ApiModelProperty(value = "支付金额")
    @TableField("totalAmount")
    private BigDecimal totalAmount;

    @ApiModelProperty(value = "支付方式:1支付宝 2微信")
    @TableField("payment_method")
    private Byte paymentMethod;

    @ApiModelProperty(value = "第三方交易号")
    @TableField("transaction_id")
    private String transactionId;

    @ApiModelProperty(value = "状态:0未支付 1支付成功 2支付失败")
    @TableField("status")
    private Byte status;

    @ApiModelProperty(value = "支付时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("pay_time")
    private Date payTime;

    @ApiModelProperty("回调时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("callback_time")
    private Date callbackTime;

    @ApiModelProperty("回调内容")
    @TableField("callback_content")
    private String callbackContent;

    @ApiModelProperty("优惠金额")
    @TableField("discountAmount")
    private BigDecimal discountAmount;
}